// 企业相关的接口函数
import request from '@/utils/http.js'

//添加企业
export const addInformationAPI = (data) =>{
    return request({
        url: '/enterprise/addInformation',
        method: 'post',
        data:{
            account: data.account,
            userRole: data.userRole,
            enterpriseName: data.enterprise_name,
            enterpriseCertificate:data.enterpriseCertificate,
            enterpriseCertificateFile:data.enterpriseCertificateFile,
            enterpriseLogoUrl: data.enterprise_logo_url,
            enterpriseProfile: data.enterprise_profile,
            enterpriseIndustry: data.enterprise_industry,
            enterpriseSize: data.enterprise_size,
            enterpriseFoundationDate: data.enterprise_foundation_date,
            enterpriseType: data.enterprise_type,
            enterpriseAddress: data.enterprise_address,
            enterpriseEmail: data.enterprise_email,
            enterpriseWebsite: data.enterprise_website,
            enterpriseCertificationStatus: data.enterpriseCertificationStatus,
            enterpriseSocialMediaLinks: data.enterprise_social_media_links,
        }
    })
}

//查询企业信息根据企业绑定的用户id
export const queryInformationByUserIdAPI = (enterpriseUserId) => {
    return request({
        url: '/enterprise/queryInformationByUserId',
        method: 'post',
        params: { enterpriseUserId }
    })
}

//查询企业信息通过企业Id
export const queryInformationByIdAPI = (enterpriseId) => {
    return request({
        url: '/enterprise/queryInformationById',
        method: 'post',
        params: { enterpriseId }
    })
}

//分页查询企业信息
export const pageInformationAPI = (data) => {
    return request({
        url: '/enterprise/pageInformation',
        method: 'post',
        data: {
            pageCurrent: data.pageCurrent,
            pageSize: data.pageSize,
            enterpriseCertificationStatus: data.enterpriseCertificationStatus,
        }
    })
}

//更新企业信息
export const updateInformationByIdAPI = (data) => {
    return request({
        url: '/enterprise/updateInformationById',
        method: 'post',
        data: {
            enterpriseId: data.enterpriseId,
            enterpriseCertificate:data.enterpriseCertificate,
            enterpriseCertificateFile:data.enterpriseCertificateFile,
            enterpriseCertificationStatus: data.enterprise_certification_status,
            enterpriseCertificationRefuse:data.enterprise_certification_refuse,
            enterpriseName: data.enterprise_name,
            enterpriseLogoUrl: data.enterprise_logo_url,
            enterpriseProfile: data.enterprise_profile,
            enterpriseIndustry: data.enterprise_industry,
            enterpriseSize: data.enterprise_size,
            enterpriseFoundationDate: data.enterprise_foundation_date,
            enterpriseType: data.enterprise_type,
            enterpriseAddress: data.enterprise_address,
            enterpriseEmail: data.enterprise_email,
            enterpriseWebsite: data.enterprise_website,
            enterpriseSocialMediaLinks: data.enterprise_social_media_links,
            enterpriseUserId: data.enterpriseUserId,
        }
    })
}
//获取热门企业
export const getHotEnterpriseListAPI = () => {
    return request({
        url: '/enterprise/queryHotEnterprise',
        method: 'post',
        params: {
        }
    })
}
